/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.acworks.acroute;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author nikita
 */
public class Util {

    private Util() {
    }

    public static Set<Space> findSpacesByType(Collection<Space> spaces, SpaceType type) {
        assert spaces != null;
        assert type != null;

        Set<Space> ownedSpaces = new HashSet<Space>();
        for (Space s : spaces) {
            if (s.getSpaceType() == type) {
                ownedSpaces.add(s);
            }
        }
        return ownedSpaces;
    }
}
